package com.kma.summer2012.client.view.catalog;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Widget;
import com.kma.summer2012.client.presenters.catalog.CatalogWidgetPresenter;
import com.kma.summer2012.client.styles.style2.Recources;
import com.smartgwt.client.widgets.tree.TreeGrid;

public class CatalogWidgetView extends Composite implements CatalogWidgetPresenter.Display {
    interface CatalogWidgetViewUiBinder extends UiBinder<Widget, CatalogWidgetView> {
    }

    private static CatalogWidgetViewUiBinder ourUiBinder = GWT.create(CatalogWidgetViewUiBinder.class);
    @UiField
    protected TreeGrid catalog;

    public CatalogWidgetView() {
        HTMLPanel rootElement = (HTMLPanel) ourUiBinder.createAndBindUi(this);
        initWidget(rootElement);
        catalog.setStyleName(Recources.INSTANCE.styles().imgHeaderButton());
        catalog.addStyleName(Recources.INSTANCE.styles().headerButton());
        catalog.addStyleName(Recources.INSTANCE.styles().imgHeaderButtonSelected());
        catalog.addStyleName(Recources.INSTANCE.styles().headerButtonSelected());
        catalog.addStyleName(Recources.INSTANCE.styles().listGrid());

    }

    @Override
    public TreeGrid getTreeGrid() {
        return catalog;
    }

    @Override
    public Widget asWidget() {
        return this;
    }
}